# 编译器设置
CC = gcc
CFLAGS = -g -Wall -I../sqlite3/include -I. 
LDFLAGS = -L../sqlite3/lib -lsqlite3 -lpthread -ldl -lm

# 目标文件
TARGET = server_app
SRCS = server.c logger.c pack_data.c sqlite.c
OBJS = $(SRCS:.c=.o)

# 构建规则
all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean
